import sys
from pylab import *

#serpent_id #sigla_estado

f = open(sys.argv[1],"r")
g = open(sys.argv[2],"r")

contf = 0
for line in f:
	contf += 1

contg = 0
for line in g:
	contg += 1

total = contf
pec = contg
boas = contf - contg

pec = float(pec)/float(total)
boas = float(boas)/float(total)

"""
Make a pie chart - see
http://matplotlib.sf.net/matplotlib.pylab.html#-pie for the docstring.

This example shows a basic pie chart with labels optional features,
like autolabeling the percentage, offsetting a slice with "explode"
and adding a shadow.

Requires matplotlib0-0.70 or later

"""


# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])

labels = 'Peconhentas', 'Normais'
fracs = [pec,boas]

explode=(0, 0)
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
title('Porcentagem de peconhentas', bbox={'facecolor':'0.8', 'pad':5})

show()


